package com.cjy.common.bean;

import java.util.HashMap;

/**
 * 扩展HashMap，方便链式编程，Map添加批量数据推荐链式编程，更清晰 2013-12-6 上午9:24:02
 * 
 * @author jay.zhoujingjie
 */
public class OpAttributes<E, T> extends HashMap<E, T> {

	private static final long serialVersionUID = 1L;

	public OpAttributes() {
		super();
	}

	public OpAttributes(E key, T value) {
		super.put(key, value);
	}

	/**
	 * 添加
	 * 
	 * @author jay.zhoujingjie
	 * @param key
	 * @param value
	 * @return Attributes
	 */
	public OpAttributes add(E key, T value) {
		super.put(key, value);
		return this;
	}

	/**
	 * 过滤 / 删除
	 * 
	 * @author jay.zhoujingjie
	 * @param args
	 * @return Attributes
	 */
	public OpAttributes filter(String... args) {
		if (args != null) {
			for (String arg : args) {
				super.remove(arg);
			}
		}
		return this;
	}

}
